// ExpressionStmt.cpp: implementation of the ExpressionStmt class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "Expression.h"
#include "ExpressionStmt.h"
#include "AccidenceAnalyzer.h"
#include "Simple_Expression.h"
#include "CommaExpression.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

ExpressionStmt::ExpressionStmt()
{

}

ExpressionStmt::~ExpressionStmt()
{

}

BOOL ExpressionStmt::Interpret()
{
	ComplierNote* pNote = new CommaExpression;
	pNote->SetOwner(this);
	LeftNote(pNote);

	if(!pNote->Interpret())
	{
		this->ErrorInfo(pNote->ErrorInfo());
		return FALSE;
	}
	return TRUE;
}

Variable ExpressionStmt::Execute()
{
	return LeftNote()->Execute();
}